window.onload = function () {
    $(".ui-button").css("font-size", "12px");
    $(".ui-jqgrid-view ").css("font-size", "12px");

};


//优惠悬浮框功能 star
function scrollBanner(timer, moveNumber) {

    function move(o) {
        var st = document.documentElement.scrollTop + o.t;
        var sl = document.documentElement.scrollLeft + (o.c == 0 ? o.a : document.documentElement.clientWidth - o.a - o.offsetWidth);
        var tc = st - o.offsetTop, lc = sl - o.offsetLeft;
        with (o.style) {
            top = o.offsetTop + (tc != 0 ? tc / Math.abs(tc) : 0) * Math.min(Math.abs(tc), moveNumber) + "px";
            left = o.offsetLeft + (lc != 0 ? lc / Math.abs(lc) : 0) * Math.min(Math.abs(lc), moveNumber) + "px";
        }
        _fixed(o);
    }


    var _fixed = function (o, t, a, c) {
        if (o.person) {
            with (o.person.style) {
//                top = o.offsetTop + "px";
//                left = o.offsetLeft + o.offsetWidth - o.person.offsetWidth + "px";
                top = "0px";
                left = "0px";
            }
        }
        if (t && a) {
            with (o.style) {
                position = "absolute";
                top = t + "px";
                if (c) {
                    right = a + "px";
                    left = "auto";
                } else {
                    left = a + "px";
                }
                display = "block";
            }
        }
        o.style.position = "fixed";
    }

    var hidden = function () {
        var o = this.parent;
        if (o) {
            window.clearInterval(o.interval);
            o.parentNode.removeChild(o);
            this.parentNode.removeChild(this);
        }
    };

    this.add = function (to, t, a, c, lo, nom) {
        /*
         * 当 nom 不是 undefined 或 0 并且 c != 0 时
         * a 为 to 的宽度加上距离右边的距离
         */

        /*
         to为object对象
         t为距离顶端距离
         当c   =   0的时候，a为距离左边的距离
         当c   !=   0的时候，a为距离右边的距离
         lo为关闭按钮
         */
        var div, exec = function () {
            move(to);
        };

        if (lo) {
            to.person = lo;
        }
        to.t = t;
        to.a = a;
        to.c = c;
        with (to.style) {
            if (!nom) {
                position = "absolute";
                display = "block";
            }
            top = document.documentElement.scrollTop + t;
            left = document.documentElement.scrollLeft + (c == 0 ? a : document.documentElement.clientWidth - a - to.offsetWidth);
        }

        if ("undefined" != typeof   lo) {
            with (lo.style) {
                position = "absolute";
                display = "block";
            }
            lo.onmousedown = hidden;
            lo.parent = to;
        }
        if (nom) {
            _fixed(to, t, a, c);
        } else {
            exec();
            to.interval = window.setInterval(exec, timer);
        }
    };
}

//优惠悬浮框功能 end